package StudyCode.summary.textfile;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class SaveTextStringToFileWithBufferedWriterAndFileWriter {
	public static void main(String[] args) throws IOException {
		StringBuffer sbf = new StringBuffer();

		sbf.append("www.tah1986.com");
		sbf.append(System.getProperty("line.separator"));
		sbf.append("科技与人文.");

		BufferedWriter bwr = new BufferedWriter(new FileWriter(new File("E:/Copy/test1.txt")));

		bwr.write(sbf.toString());
		bwr.flush();
		bwr.close();
		System.out.println("字符串保存到文本文件成功.");
	}
}
